package day12.demo1;

/**
 * @Auther:小陈的Java
 */
public class ThreadDemo3 extends Thread{
        public static void main(String[] args) throws InterruptedException {
                Thread thread = new ThreadDemo3();
                thread.start();;
                thread.setName("子线程1");
                System.out.println(Thread.currentThread().getName());
        }
        @Override
        public void run() {
                try {
                        System.out.println("子线程："+this.getName());
                        Thread.sleep(5000);
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }

        }
}
